﻿#--------------------------------------------------------------------------------------------------------------------------------------------------------
#
# Mi-DevEnv			:	http://midevenv.codeplex.com 
#					:	(c) IT Bridge 2012
#					:	A concept originated by Chris Nurse
#
# Licence			:	GNU General Public License version 2 (GPLv2)
#					:	http://midevenv.codeplex.com/license
#
# Summary           :   The purpose of this file is to copy the master scripts from MDE to the local machine
# Actions           :   Update the local files, deploy modules, generate customised scripts
#
#--------------------------------------------------------------------------------------------------------------------------------------------------------

Set-StrictMode -Version Latest
Remove-Module * -ErrorAction SilentlyContinue
Import-Module MDE-Common

[string]$executionPath = Split-Path $script:MyInvocation.MyCommand.Path -Parent

Write-Host "Refresh scripts from $ScriptSource"
Copy-Item $ScriptSource\*.* $LocalRootFolder -Recurse -Force -Confirm:$false 

Remove-Module MDE-Common -ErrorAction SilentlyContinue

& $executionPath\MDE-Deploy.ps1 

Import-Module MDE-Common

Write-Host "Generate customised scripts"
Copy-DeploymentScripts -Source "$ScriptSource\MDE-TemplateScripts" -Destination "$LocalRootFolder\MDE-Installers"